import turtle
from tkinter import *
root = Tk()
root.title('类正方形')
length = 2
cv = Canvas(root, width=800, height=600)
cv.pack()
screen = turtle.TurtleScreen(cv)
t = turtle.RawTurtle(screen)
t.speed(3)
for i in range(4 * 10):
    t.forward(length)
    t.left(91)
    length += 4
root.mainloop()